package com.seewintech.framework.common.exception;

/**
 * @author by xiaoTian
 * @date 2022/6/14.
 */
/**
 * 错误码枚举
 * 系统级异常，使用 2_001_001_ 段
 */
public enum SystemExceptionEnum implements ExceptionEnum {
    /**
     * 系统异常
     */
    SYSTEM_EXCEPTION(2_001_001_000, "服务端发生异常"),
    MISSING_REQUEST_PARAM_EXCEPTION(2_001_001_001, "参数缺失"),
    VALIDATION_REQUEST_PARAM_EXCEPTION(2_001_001_002, "参数校验不正确"),
    METHOD_EXCEPTION(2_001_001_003, "访问路径错误"),
    NOT_PAGE_REQUEST(2_001_001_004, "不是分页结果集"),
    ;
    /**
     * 异常码
     */
    private final int code;
    /**
     * 异常信息
     */
    private final String message;


    SystemExceptionEnum(Integer code, String message) {
        this.message = message;
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message + "!";
    }

    @Override
    public Integer getCode() {
        return code;
    }
}
